#!/usr/bin/env python
# @FileName :app.py
# @Time :2025/8/20 09:53
# @Author :chenjiajun
import os

from flask import Flask
from flask_cors import CORS

def create_app():
    app = Flask(__name__)
    CORS(app)
    app.config.from_object('config.setting')

    if 'FLSAK_ENV' in os.environ:
        app.config.from_envvar('FLSAK_ENV')

    #蓝图注册
    import route
    route.init_app(app)

    #绑定ORM
    import model
    model.init_app_db(app)

    return app